package com.zmj.api.impl;

import com.zmj.annotion.RpcService;
import com.zmj.common.api.service.CommunionService;
import com.zmj.common.data.CacheData;
import com.zmj.common.model.User;
import com.zmj.common.response.ServerResponse;
import lombok.extern.slf4j.Slf4j;

/**
 * 用途：
 * @author zhangmj
 * @date 2018/9/22 21:24
 */
@Slf4j
@RpcService(CommunionService.class)
public class CommunionServiceImpl implements CommunionService {

    @Override
    public ServerResponse<String> hello(String name) {
        log.info("RPC 服务端接收到客户端信息:{}",name);
        return ServerResponse.createBySuccess("Hello "+ name);
    }

    @Override
    public ServerResponse<User> getInfo(Integer personCode) {
        User user = CacheData.getUserInfo(personCode);
        return ServerResponse.createBySuccess(user);
    }
}
